<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>专业量表测试</title>
<link href="/stylesheets/survey_public.css"  rel="stylesheet" type="text/css"/>
  <script src="/javascripts/prototype.js" type="text/javascript"></script>
<style>
#content{ width:840px; float:left; padding-left:35px; margin-top:28px;height:auto !important;height:550px;min-height:550px;}
.js{ width:840px; float:left;margin-top:10px;}
.left{ width:195px; float:left; height:425px; background:url(/images/user/prof_survey/leftbg.jpg) no-repeat;}
.left ul{ width:195px;}
.left ul li{ height:36px; line-height:36px; width:180px; text-align:center;}
.left ul li.js02{ height:31px; line-height:31px;}
.left ul li.js01{ height:39px; width:195px; background:url(/images/user/prof_survey/anniu_03.jpg) no-repeat; line-height:39px;}
.left ul li.js01 a{ color:#2376b5;}
.left ul li.js03{ height:39px; width:195px; background:url(/images/user/prof_survey/ad.png) no-repeat; line-height:39px;}
.left ul li.js03 a{ color:#2376b5;}
.left ul li.js04{ height:39px; width:195px; background:url(/images/user/prof_survey/ad.png) no-repeat; line-height:39px; text-align:left;}
.left ul li.js04 a{ color:#2376b5; padding-left:20px;}
.right{ width:620px; float:left; padding-left:16px;}
.right p{ line-height:20px; color:#000000; float:left; width:300px; padding-left:10px; }
.right span{ line-height:20px;  float:right; width:230px; padding-right:10px; }
/*.line{ width:585px; height:1px; background:url(/images/user/prof_survey/line.jpg) no-repeat; float:left;}*/
.clear{ clear:both;}
.right01{ width:600px; height:152px; float:left; margin-top:10px;}
.right01 ol li img{width:110px; height:110px;}
.right ol li{ width:136px; height:132px; float:left;}
.right dl{ width:440px; height:112px;}
.right dl dt{ width:440px; line-height:24px; color:#1981d1; font-size:14px;}
.right dl dd{ width:440px; line-height:20px; color:#304d62;}
.right ul li{ width:117px; height:23px; float:right; padding-right:48px;}

.right2{ width:579px; float:left;}
.right201{ width:569px; float:left;margin:5px 0 0 15px;}
.right2a{ width:519px; float:left;  margin:20px 0 0 15px;}
.right2a  h1{ width:515px; height:25px; float:left; padding-left:3px;font-size:14px;}
.right2a ul{ width:516px;  float:left; }
.right2a ul li{ width:257px; height:31px; float:left; line-height:31px; text-align:left; }


.right202{ width:569px; float:left;}
.right202{ width:569px; float:left;}

.back{ width:102px; height:30px; float:right; padding-right:20px; margin-top:5px;}
#footer{ width:100%; height:200px; float:left; background:url(/images/user/prof_survey/footer.jpg) no-repeat; text-align:center; color:#295c72;}
#footer h1{ margin-top:100px;}
</style>
<script src="/javascripts/survey.js"></script>
</head>
<script>

  function go(v){
    window.location = '/user/test/prof_surveys_by_type?type_id=' +v
  }
 
  function init(){
    var args = new Object();
    var query = location.search.substring(1);//获取查询串
    var pos = query.split('=');//查找name=value
    var value = pos[1];//提取value
    if(value){
      var li = document.getElementById("type_li"+value);
      li.style.height="39px" ;
      li.style.width="195px" ;
      li.style.background="transparent url(/images/user/prof_survey/ad.png)";
      show_right();
    }else{
      var lii=$("type_li0");
      lii.style.height="39px" ;
      lii.style.width="195px" ;
      lii.style.background="transparent url(/images/user/prof_survey/ad.png)" ;
      //show_right2();
      $("right2").show();
    }
  }

  function show_right(){
    $("right2").hide();
    $("right").show();
  }

  function show_right2(){
    window.location = "/user/test/prof_surveys";
    //$("right").hide();
    $("right2").show();
    //change_all_bd();
  }
 
  function change_all_bd(){
    var query=location.search.substring(1);//获取查询串   
    var pos=query.split('=');//查找name=value   
    var value=pos[1];//提取value 
    if(value){
    var li=document.getElementById("type_li"+value);
    li.style.height="36px" ;
    li.style.width="180px" ;
    li.style.background="transparent url(/images/user/prof_survey/nav04.jpg)" ;
    }
    else{
    var lii=document.getElementsByClassName("first");
    lii[0].style.height="36px" ;
    lii[0].style.width="180px" ;
    lii[0].style.background="transparent url(/images/user/prof_survey/nav02.jpg)" ;
    }
    var all=$("type_li0");
    all.style.height="39px" ;
    all.style.width="195px" ;
    all.style.background="transparent url(/images/user/prof_survey/ad.png)" ;
  }
</script>
<body onload="init();">
<div id="page">
	   <div id="header">
         <ol>
        <li><img src="/images/user/prof_survey/biao_05.jpg" width="271" height="53" /></li>
        </ol>
        <ul>
          <li id="org-text"> <%=current_user.name%></li>
          <li><a href="/login/logout">安全退出</a></li>
        </ul>
    </div><!--header -->
	<div id="content">
		<div id="b1" class="js">
			  <div class="left">
				    <ul>
				    <li id="type_li0" style="text-align:center;">
				       <a href="#" onclick="show_right2();">
	            全部量表
	             </a>
				    </li>
				    <% i=2%>
				    <% SurveyType.find_by_org_id(current_user.id).each do |type| %>
				    <% if i <=4%>
				    <li id="type_li<%=type.id%>" 
				    <% if i==2-%>
                   class="first"
				    <% end %>
				    style="background:url(/images/user/prof_survey/nav0<%=i%>.jpg);height:39px">
				    <% else %>
				    <li id="type_li<%=type.id%>" style="background:url(/images/user/prof_survey/nav04.jpg)">
				    <% end %>
				    <a href="#"  
				    onclick="go(<%=type.id%>)"><%=type.name%></a></li>
				    <%i=i+1%>
				    <% end %>
				    <% if i >= 4%>
				    <li id="type_li<%=type.id%>" style="background:url(/images/user/prof_survey/nav04.jpg)">
				    </li>
				    <% end -%>
				    </ul>
			  </div><!--left-->
            <div  id="right" class="right"  style="display:none;">
            	<p>
            	<% if  @tests[0]%>
            	<%=truncate(@tests[0].survey_type.description,:length=>170) %>
                <% end %>
                  </p>
                  <span>
                    <a href="/user/test/home"><img src="/images/back.png" width="88" height="27" style="margin:0 10px 0 105px"/></a>
                  </span>
                 <% for test in @tests %>
			      	<div class="right01">
                	<ol>
                    <li>
                    <% @images = test.images
                        if @images.size >0
                     %>
                       <% if  test.status == TEST_STATUS_FINISHED %>
                       <a href="/user/test/test/<%=test.id%>">
                       <% end %>
                    <img src="<%='/images/uploads/fullsize/'+test.images[0].attributes['filename'] %>" width="110px" heigth="110px"/>
                    </a>
                    <% else %>
                      <% if  test.status == TEST_STATUS_FINISHED %>
                       <a href="/user/test/test/<%=test.id%>">
                       <% end %>
                    <img src="/images/user/prof_survey/hunyin_03.jpg" width="110px" height="110px" /></li>
                    </a>
                    <% end %>
                    </ol>
                    <dl>
                    <dt><%=test.name%></dt>
                    <dd><%=h truncate(test.description, :length => 160)%><br />
                     </dd>
                    </dl>
                    <ul>
                    <li>
                    <% if  test.status == TEST_STATUS_FINISHED %>
                     <a href="/user/test/test/<%=test.id%>">
                     <img src="/images/user/prof_survey/ce.jpg" width="117" height="23" />
                    </a>
                    <% else %>
                    <font style="margin:0 0 0 30px;"color="#3C95D5" >暂停使用</font>
                    <img src="/images/user/prof_survey/ce.jpg" width="117" height="23" />
                     <% end %>
                    </li>
                    </ul>
                </div>
                    <%end%>
                <div class="line"></div>
            </div><!--right-->


              <div class="right2" id="right2" style="display:none;">
              <div class="back">
                 <a href="/user/test/home"><img src="/images/back.png" width="88" height="27" /></a>
              </div>            
                    <div id="right201"  class="right2" style="display:none;" >
                     <div class="right2a">
                          <h1 style="text">常用量表：</h1><br />
                          <br />
                            <font color="#1C94E6" margin-left="20px">＊ 黑体字显示量表表示您暂时还没有该量表的使用权限</font>
                             <br /> <br />
                            <ul>
                            <li><% if surveys_authorith(83) %>
                            <a href="/user/test/test/83">明尼苏达多项个性测验量表（MMPI）</a>
                            <% else %><b>明尼苏达多项个性测验量表（MMPI）</b>
                            <% end %></li>
                            <li><% if surveys_authorith(85) %>
                            <a href="/user/test/test/85">艾森克EPQ－人格测定量表</a>
                            <% else %><b>艾森克EPQ－人格测定量表</b>
                            <% end %></li>                       
                            <li><% if surveys_authorith(87) %>
                            <a href="/user/test/test/87">瑞文推理测试</a>
                            <% else %><b>瑞文推理测试</b>
                            <% end %></li>
                            <li><% if surveys_authorith(70) %>
                            <a href="/user/test/test/70">抑郁自评量表（SDS）</a>
                            <% else %><b>抑郁自评量表（SDS）</b>
                            <% end %></li>
                            <li><% if surveys_authorith(54) %>
                            <a href="/user/test/test/54">焦虑自评量表（SAS）</a>
                            <% else %><b>焦虑自评量表（SAS）</b>
                            <% end %></li>
                            <li><% if surveys_authorith(37) %>
                            <a href="/user/test/test/37">症状自评量表（SCL-90）</a>
                            <% else %><b>症状自评量表（SCL-90）</b>
                            <% end %></li>
                            <li><% if surveys_authorith(84) %>
                            <a href="/user/test/test/84">卡特尔16种人格因素测验（16PF）</a>
                            <% else %><b>卡特尔16种人格因素测验（16PF）</b>
                            <% end %></li>
                            <li><% if surveys_authorith(39) %>
                            <a href="/user/test/test/39">NYLS 3-7岁儿童气质问卷 </a>
                            <% else %><b>NYLS 3-7岁儿童气质问卷 </b>
                            <% end %></li>
                            <li><% if surveys_authorith(91) %>
                            <a href="/user/test/test/91">网络成瘾自测（IAT）</a>
                            <% else %><b>网络成瘾自测（IAT）</b>
                            <% end %></li>
                            <li><% if surveys_authorith(93) %>
                            <a href="/user/test/test/93">A型行为类型问卷（TABP）</a>
                            <% else %><b>A型行为类型问卷（TABP）</b>
                            <% end %></li>
                            </ul> 
                            <br />
                        </div>
                      </div>
                   <div class="right202">
                       <div class="right2a">
                          <h1> 您当前可用量表(共<%=@test_num%> 个量表)：</h1><br />
                          <ul>
                          <% if @all_tests.size > 0 %>
                          <% @all_tests.each do |t| %>
                          <li style="text-align:left;"> 
                            <a href="/user/test/test/<%=t.id%>" style="color:#39AFCD;"><%=t.name%> </a>
                          </li>
                          <% end %>
                          <% else %>
                          <li>没有量表</li>
                          <% end %>
                          </ul>
                      </div>
                  </div>
                  <div class="right203">
                       <div class="right2a">
                          <h1> 系统所有量表(共<%=@system_surveys.size%> 个量表)：</h1><br />
                          <ul>
                          <% @system_surveys.each do |t| %>
                          <li style="text-align:left;"> 
                            <span style="color:#A78D1E;"><%=t.name%>
                          </li>
                          <% end %>
                          </ul>
                      </div>
                  </div>
         </div><!--right2 end-->
          <div class="back">
                 <a href="/user/test/home"><img src="/images/back.png" width="88" height="27" /></a>
              </div>
            </div><!--b1-->
        </div><!--content-->
       </div><!--page-->
             
      <div id="footer">
        <h1>北京心嘉源咨询有限公司 CopyRight © www.iyaoi.cn 2009</h1>
      </div>
</body>
</html>
